﻿<!--
//===============================================================================
// Mammoth Patter Miner 2008
//===============================================================================
// Copyright (C) 2008 Arkadiusz Świerczek and Piotr Włodek. All rights reserved.
//===============================================================================
// Defines user interface for the AboutView.
//===============================================================================
-->

<Window x:Class="WpfRcp.Views.Windows.AboutWindow" x:Name="m_Window"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Helpers="clr-namespace:WpfRcp.Helpers"
        xmlns:Regions="clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation"
        xmlns:Globals="clr-namespace:WpfRcp.Core.Globals;assembly=WpfRcp.Core"
        xmlns:Behaviors="clr-namespace:WpfRcp.Controls.Behaviors;assembly=WpfRcp.Controls"
        Title="{Binding Source={x:Static Helpers:ResHelper.Instance}, Path=Resource[AboutDialogName]}"
        ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" Background="Transparent"
        SizeToContent="Height" Width="660" WindowStyle="None" AllowsTransparency="True"
        Behaviors:WindowBehavior.HideInsteadClose="True">

    <Window.Resources>
        <Style x:Key="buttonStyle" TargetType="ButtonBase" >
            <Setter Property="Focusable" Value="True" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="Width" Value="120" />
            <Setter Property="Height" Value="30" />
            <Setter Property="Padding" Value="5" />
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="BorderBrush" Value="#797f87" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ButtonBase">
                        
                        <Border x:Name="border" Background="#4a535f" CornerRadius="4" Margin="1"
                                BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}"
                                SnapsToDevicePixels="True">
                            <Grid>
                                <ContentPresenter Margin="{TemplateBinding Control.Padding}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" RecognizesAccessKey="True" Content="{TemplateBinding ContentControl.Content}" />
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter Property="BorderBrush" Value="White" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="border" Property="Background" Value="#EE424242" />
                                <Setter TargetName="border" Property="Opacity" Value="0.5" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="border" Property="Background" Value="#566578" />
                                <Setter Property="BorderBrush" Value="#2f507b" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="border" Property="Background" Value="#636d79" />
                                <Setter Property="BorderBrush" Value="#2e5487" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    
    <Border BorderBrush="{StaticResource WindowBorder}" BorderThickness="1" CornerRadius="8">
        <Border.Background>
            <LinearGradientBrush EndPoint="0.455,0.996" StartPoint="0.457,0.038">
                <GradientStop Color="#FF070E18" Offset="0"/>
                <GradientStop Color="#FF8B96A3" Offset="1"/>
            </LinearGradientBrush>
        </Border.Background>
        
        <Grid Margin="10" TextBlock.Foreground="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="260" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="260" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Image Width="256" Height="256" Source="{Binding RcpSettings.AboutBoxImage}" />

            <StackPanel Grid.Column="1">
                <Grid Margin="0,0,0,25">
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontFamily="Segoe" FontSize="28" FontStretch="Normal" FontWeight="Light"
                                    TextWrapping="Wrap" Foreground="#FF9C9FA3" Text="{Binding RcpSettings.AppName}" />
                            <TextBlock FontFamily="Segoe" FontSize="28" FontStretch="Normal" FontWeight="Light"
                                    TextWrapping="Wrap" Foreground="#FFFFFFFF" Text="{Binding RcpSettings.AppNameExtended}" Margin="5 0 0 0" />
                            <TextBlock FontFamily="Segoe" FontSize="14" FontWeight="Normal" Foreground="#FF9C9FA3"
                                    FontStretch="Normal" TextWrapping="Wrap" Text="{Binding RcpSettings.VersionSuffix}" Margin="5 0 0 4" VerticalAlignment="Bottom" />
                        </StackPanel>
                        
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontFamily="Segoe" FontSize="10" FontStretch="Normal" FontWeight="Light" FontStyle="Italic"
                                       TextWrapping="Wrap" Foreground="#FF9C9FA3" Text="Powered by" />
                            <TextBlock FontFamily="Segoe" FontSize="10" FontStretch="Normal" FontWeight="Light"
                                       TextWrapping="Wrap" Foreground="#FFFFFFFF" Text="Mammoth RCP" Margin="5 0 0 0" />
                            <TextBlock FontFamily="Segoe" FontSize="10" FontWeight="Normal" Foreground="#FF9C9FA3"
                                       FontStretch="Normal" TextWrapping="Wrap" Text="{Binding VersionString}" Margin="5 0 0 4" VerticalAlignment="Bottom" />
                        </StackPanel>
                    </StackPanel>
                </Grid>
                
                <ContentControl Regions:RegionManager.RegionName="{x:Static Globals:RegionNames.AboutRegion}" />
            </StackPanel>

            <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
            
                <Button Style="{StaticResource buttonStyle}"
                        Content="OK" Command="{Binding CloseCommand}"></Button>
                
                <Button Style="{StaticResource buttonStyle}"
                        Content="{Binding Source={x:Static Helpers:ResHelper.Instance}, Path=Resource[Modules]}"
                        Command="{Binding OpenModuleInfoCommand}"></Button>
                
            </StackPanel>
            
        </Grid>        
        
    </Border>
</Window>
